import { CommonType } from '@/common/dto/common.type';
import { CardType } from '@/modules/card/dto/card.type';
import { OrganizationType } from '@/modules/organization/dto/organization.type';
import { Field, ObjectType } from '@nestjs/graphql';
@ObjectType()
export class ProductType extends CommonType {
  @Field({
    description: '名称',
    nullable: true,
  })
  name?: string;
  @Field({
    description: '描述',
    nullable: true,
  })
  desc?: string;
  @Field({
    description: '库存总数',
    nullable: true,
  })
  stock?: number;
  @Field({
    description: '当前库存',
    nullable: true,
  })
  curStock?: number;
  @Field({
    description: '卖出去多少',
    nullable: true,
  })
  buyNumber?: number;
  @Field({
    description: '每人限购数量',
    nullable: true,
  })
  limitBuyNumber?: number;
  @Field({
    description: '封面图',
    nullable: true,
  })
  coverUrl?: string;
  @Field({
    description: '头部Banner',
    nullable: true,
  })
  bannerUrl?: string;
  @Field({
    description: '原价',
    nullable: true,
  })
  orginalPrice?: number;
  @Field({
    description: '优惠价',
    nullable: true,
  })
  preferentialPrice?: number;

  @Field(() => OrganizationType, {
    description: '门店',
    nullable: true,
  })
  org?: OrganizationType;
  @Field(() => [CardType], {
    description: '消费卡',
    nullable: true,
  })
  cards?: CardType[];
}
